<!DOCTYPE html>
<html>
<head>
<meta name="robots" content="none" />
<?php
$name = system_controller_front::getInstance()->getRequest()->getActionName();
$root = preg_replace_callback('/^([a-zA-Z]{1})(.*)$/is', create_function('$match', 'return strtoupper($match[1]).$match[2];'), $name);
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<meta http-equiv="Content-Language" content="<?php echo str_replace('_', '-', $this->language()->getName());?>" >
<link rel="shortcut icon" href="<?php echo $this->baseUrl('/favicon.ico');?>"/>
<title><?php echo $this->language($root);?> - Control Panel</title>
<link href="<?php echo $this->baseUrl(_STATIC_HTTP . '/admin/css/index.css');?>" rel="stylesheet" type="text/css" >
<link href="<?php echo $this->baseUrl(_STATIC_HTTP . '/admin/css/lang/' . $this->language()->getName() . '.css');?>" rel="stylesheet" type="text/css" >
<script type="text/javascript" src="<?php echo $this->baseUrl(_STATIC_HTTP . '/jquery/jquery-1.7.min.js');?>"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl(_STATIC_HTTP . '/admin/js/index.js');?>"></script>
<base target="mainFrame" />
</head>

<body id="panel-<?php echo $root;?>">
<div id="menu">
	<ul>
		<li<?php if($name == 'index') {?> class="active"<?php } ?>><a href="<?php echo $this->url('index/index');?>" target="_self"><?php echo $this->language('Dashboard');?></a></li>
		<li<?php if($name == 'picture') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/picture');?>" target="_self"><?php echo $this->language('Picture');?></a>
			<ul>
				<li><a href="<?php echo $this->url('picture/category/index');?>"><?php echo $this->language('Category Manage');?></a></li>
				<li><a href="<?php echo $this->url('picture/photo/index');?>"><?php echo $this->language('Photo Manage');?></a></li>
				<li><a href="<?php echo $this->url('picture/special/index');?>"><?php echo $this->language('Special Manage');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'collection') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/collection');?>" target="_self"><?php echo $this->language('Collection');?></a>
			<ul>
				<li><a href="<?php echo $this->url('picture/collection/list');?>"><?php echo $this->language('Site');?></a></li>
			</ul>
		</li>
		<li<?php if($name == 'system') {?> class="active"<?php } ?>>
			<a href="<?php echo $this->url('index/system');?>" target="_self"><?php echo $this->language('System Manage');?></a>
			<ul>
				<li><a href="<?php echo $this->url('system/setting/index');?>"><?php echo $this->language('Global Setting');?></a></li>
				<li><a href="<?php echo $this->url('system/user/index');?>"><?php echo $this->language('User');?></a></li>
			</ul>
		</li>
	</ul>
</div>
<form action="<?php echo $this->url('index/index');?>" method="post" target="_self">
<div id="header" class="header">
	<h1><?php echo system_user_control::$_title;?><sup>.com ®</sup></h1>
	<div>
		<h3>Welcome to <?php echo system_user_control::$_title;?>,Inc! <label><select name="language" onchange="this.form.submit();"><?php 
			$_lang = system_user_instance::getInstance()->getSession()->getLanguage();
			foreach(new system_setting_language() AS $lang) {
				echo '<option value="' . strtolower($lang->getKey()) . '"';
				if(strtolower($_lang) == strtolower($lang->getKey())) echo ' selected="selected"';
				echo '>' . $lang->getName() . '</option>';
			}
		?></select></label></h3>
		<p>
			<?php echo $this->language('Hi');?>,<strong><?php echo system_user_instance::getInstance()->getSession()->getIdentity();?></strong><?php
			if($this->user) {
				echo '(' . $this->user->getGroupName() . ')';
			} ?>! <a href="<?php echo $this->url('index/logout');?>" onclick="return confirm('<?php echo $this->language('Are you sure to logout system?');?>');" target="_self"><?php echo $this->language('Logout');?>!</a>
		</p>
	</div>
</div>
</form>
<div id="maskDiv"></div>
<div id="body">
<?php echo $this->content;?>
</div>
</body>
</html>